package year2022.leetcode.simple;

import java.util.LinkedHashMap;
import java.util.Set;

public class WeakestRows {

    public static void main(String[] args){
        WeakestRows o = new WeakestRows();
        int[][] mat = {{1,1,0,0,0},{1,1,1,1,0},{1,0,0,0,0},{1,1,0,0,0},{1,1,1,1,1}};
        int k = 3;
        int[] ints = o.kWeakestRows(mat, 3);
        System.out.println(ints);
    }

    public int[] kWeakestRows(int[][] mat, int k) {
        LinkedHashMap<Integer, Integer> map = new LinkedHashMap();

        for (int i=0; i<mat.length; i++){
            int sum = 0;
            for (int i1 : mat[i]) {
                if (i1<=0){
                    break;
                }
                sum += i1;
            }

            map.put(i, sum);
        }

        map.put(-10, -10);
        int[] weakest = new int[k];
        for (int i=0; i<k; i++){
            Set<Integer> set = map.keySet();
        }

        return weakest;
    }

}
